const TOKEN_KEY = 'token'
const TEAM_ID_KEY = 'team_id'

const isLogin = () => {
  return !!localStorage.getItem(TOKEN_KEY)
}

const getToken = () => {
  return localStorage.getItem(TOKEN_KEY)
}

const setToken = (token: string) => {
  localStorage.setItem(TOKEN_KEY, token)
}
const clearToken = () => {
  localStorage.removeItem(TOKEN_KEY)
}

const getTeamId = () => {
  return localStorage.getItem(TEAM_ID_KEY)
}

const setTeamId = (id: string) => {
  localStorage.setItem(TEAM_ID_KEY, id)
}
const clearTeamId = () => {
  localStorage.removeItem(TEAM_ID_KEY)
}

export { isLogin, getToken, setToken, clearToken, getTeamId, setTeamId, clearTeamId }
